package com.huayi.website.service.impl;

import com.huayi.website.entity.PhotoAttachmentEntity;
import com.huayi.website.entity.PhotoEntity;
import com.huayi.website.repository.PhotoRepository;
import com.huayi.website.service.PhotoService;
import com.huayi.website.utils.PagingResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class PhotoServiceImpl implements PhotoService {
    @Autowired
    private PhotoRepository repository;
    @Override
    public Integer editPhoto(PhotoEntity photo) {
        return repository.editPhoto(photo);
    }

    @Override
    public PhotoEntity getPhotoById(Integer photoId) {
        return repository.getPhotoById(photoId);
    }

    @Override
    public PagingResponse<PhotoEntity> getAllList(int pageIndex, int pageSize,Integer companyId) {
        return repository.getAllList(pageIndex,pageSize,companyId);
    }

    @Override
    public void deletePhoto(Integer photoId) {
        repository.deletePhoto(photoId);
    }

    @Override
    public List<PhotoAttachmentEntity> getPhotoAttachmentListById(Integer photoId) {
        return repository.getPhotoAttachmentListById(photoId);
    }
}
